<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./jquery/jQuery.min.js"></script>
</head>

<body>
  <button id="ajax_get">ajax_get</button>
  <button id="ajax_post">ajax_post</button>

  <script>
    // 跨域由后端来解决
    $('#ajax_get').click(function () {
      $.ajax({
        url: 'http://localhost:8848/list',
        type: 'get',
        success: function (data) {
          console.log(data);
        }
      })
    })
    $('#ajax_post').click(function () {
      $.ajax({
        url: 'http://localhost:8848/list',
        type: 'post',
        success: function (data) {
          console.log(data);
        }
      })
    })

  </script>

</body>

</html>